<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
			$('.manageedit').css({height:h-40});
		}
	}
	var formmain_js_formgroupname_empty  = "[%$ST.formmain_js_formgroupname_empty%]";
	var formmain_js_successtext_empty  = "[%$ST.formmain_js_successtext_empty%]";
	var formmain_js_countattrs_empty  = "[%$ST.formmain_js_countattrs_empty%]";
	var formmain_js_template_empty  = "[%$ST.formmain_js_template_empty%]";
	var formmain_js_formcode_empty  = "[%$ST.formmain_js_formcode_empty%]";
	var formmain_js_copy_ok = "[%$ST.formmain_js_copy_ok%]";
	var formmain_js_copy_no = "[%$ST.formmain_js_copy_no%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: true
		}
		$('#formedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['formgroupname']==""){
			document.formedit.formgroupname.focus();
			alert(formmain_js_formgroupname_empty);
			return false;
		}
		if(get['formcode']=="" || get['formcode'].match(/^[a-zA-Z]{3}[a-zA-Z]{1,12}$/ig)==null) {
			document.formedit.formcode.focus();
			alert(formmain_js_formcode_empty);
			return false;
		}
		if(get['countattrs']!='' || get['iscount']==1){
			if(get['countattrs'].match(/^[\w]+$/ig)==null) {
				document.formedit.countattrs.focus();
				alert(formmain_js_countattrs_empty);
				return false;
			}
		}
		if(get['template'].match(/^[\w]+$/ig)==null) {
			document.formedit.template.focus();
			alert(formmain_js_template_empty);
			return false;
		}
		if(get['successtext']=='') {
			document.formedit.successtext.focus();
			alert(formmain_js_successtext_empty);
			return false;
		}
		if(get['tmid']!='' || get['ismail']==1){
			if(get['tmid'].match(/^[1-9][0-9.]*$/ig)==null) {
				document.formedit.tmid.focus();
				alert(formmain_js_tmid_empty);
				return false;
			}
		}
		if(get['emailatt']!='' || get['ismail']==1){
			if(get['emailatt'].match(/^[\w]+$/ig)==null) {
				document.formedit.emailatt.focus();
				alert(formmain_js_emailatt_empty);
				return false;
			}
		}
		if(get['inputtime']!='' || get['isinputtime']==1){
			if(get['inputtime'].match(/^[1-9][0-9.]*$/ig)==null) {
				document.formedit.inputtime.focus();
				alert(formmain_js_inputtime_empty);
				return false;
			}
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(formmain_js_copy_ok);
		}else{
			alert(formmain_js_copy_no);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="formedit" id="formedit" method="post" action="index.php?archive=formmain&action=formsave">
	<input type="hidden" name="inputclass" value="copy">
	<input type="hidden" name="fgid" value="[%$formread.fgid%]">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<!--查看已选择的类型-->
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.formmain_copy_mess%] <u>[%$formread.formgroupname%]</u></span></span>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.formmain_add_modenametype%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_lng%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="lng">
							[%forlist from=$lng key=list%]
								<option [%$lng[list].selected%] value="[%$lng[list].lng%]">[%$lng[list].lngtitle%]</option>
							[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_formgroupname%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="formgroupname" size="40" value="[%$formread.formgroupname%]" maxlength="30" class="infoInput"/> <span class="cautiontitle">[%$ST.formmain_add_formgroupname_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_formcode%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="formcode" size="20" maxlength="30" onblur="checktypename('formcode',this.value,'index.php?archive=formmain&action=checkformname','formcodeerr','[%$ST.formmain_js_attr_input_ok%]','[%$ST.formmain_js_attr_input_no%]','submitbotton');" class="infoInput"/>
							<span class="cautiontitle" id="formcodeerr">[%$ST.formmain_add_formcode_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_purview%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="purview" id="purview">
								<option value="0">[%$ST.formmain_add_purview_option%]</option>
								[%forlist from=$memberpuvlist key=list%]
								<option  [%$memberpuvlist[list].selected%] value="[%$memberpuvlist[list].mcid%]">[%$memberpuvlist[list].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_content%]</td>
						<td width="85%" class="trtitle02"><textarea name="content" rows="3" cols="60">[%$formread.content%]</textarea></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_template%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="template" id="editformtemplate" size="20" value="[%$formread.template%]" maxlength="20" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listtab&inputtext=editformtemplate&listfunction=templatestab&typeclass=form&fileclass=other&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.formmain_add_template_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_successtext%]</td>
						<td width="85%" class="trtitle02"><textarea name="successtext" rows="3" cols="60">[%$formread.successtext%]</textarea> <span class="cautiontitle">[%$ST.formmain_add_successtext_mess%]</span></td>
					</tr>
				</table>

			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.formmain_add_baseinfo%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_ismail%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="ismail"[%if $formread.ismail==1%] checked="checked"[%/if%]> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="ismail"[%if $formread.ismail==0%] checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.formmain_add_ismail_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_emailatt%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="emailatt" size="20" value="[%$formread.emailatt%]" maxlength="20" class="infoInput"/> <span class="cautiontitle">[%$ST.formmain_add_emailatt_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_tmid%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="tmid" size="5" value="[%$formread.tmid%]" maxlength="10" class="infoInput"/> <span class="cautiontitle">[%$ST.formmain_add_tmid_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_isinputtime%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isinputtime"[%if $formread.isinputtime==1%] checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="isinputtime"[%if $formread.isinputtime==0%] checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.formmain_add_isinputtime_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_inputtime%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="inputtime" size="5" value="[%$formread.inputtime%]" maxlength="5" class="infoInput"/> <span class="cautiontitle">[%$ST.formmain_add_inputtime_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_ismenu%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="ismenu"[%if $formread.ismenu==1%] checked="checked"[%/if%]> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="ismenu"[%if $formread.ismenu==0%] checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.formmain_add_ismenu_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_isseccode%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isseccode"[%if $formread.isseccode==1%] checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="isseccode"[%if $formread.isseccode==0%] checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.formmain_add_isseccode_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_iscount%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="iscount"[%if $formread.iscount==1%] checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="iscount"[%if $formread.iscount==0%] checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.formmain_add_iscount_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.formmain_add_countattrs%]</td>
						<td width="85%" class="trtitle02"><input type="text" name="countattrs" size="20" value="[%$formread.countattrs%]" maxlength="20" class="infoInput"/> <span class="cautiontitle">[%$ST.formmain_add_countattrs_mess%]</span></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" name="Submit" value="[%$ST.botton_copy%]" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_copy_reset%]" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>